package com.miage.ldapsec.service;

import java.util.ArrayList;
import javax.naming.directory.DirContext;

import com.miage.ldapsec.obj.*;


public interface LDAPService {
  

    //Context

    public DirContext getContext();

    public boolean close();

    
    //Users

    public boolean createUser(User user);

    public boolean modifyUser(User user);

    public boolean removeUser(User user);

    public User getUser(String uid);
    
    public ArrayList<User> getAllUsers();

    public ArrayList<User> getOtherUsers(ArrayList<User> arrUser);
    
    public ArrayList<User> searchUsers(String search);

    public int nbUsers();


    //Groups

    public boolean addUserToGroup(Group group, User user);

    public void removeUserFromGroup(Group group, User user);


    //UserGroups

    public boolean createUserGroup(UserGroup group);

    public boolean modifyUserGroup(UserGroup oldGroup, UserGroup newGroup);

    public boolean removeUserGroup(UserGroup group);

    public UserGroup getUserGroup(String cn);

    public ArrayList<UserGroup> getAllUserGroups();
    
    public int nbUserGroups();

    
    //RoleGroups

    public RoleGroup getRoleGroup(String cn);

    public ArrayList<RoleGroup> getAllRoleGroups();
    
    public void removeOtherRoles(RoleGroup rolegroup, User user);


    //Tree

    public String getTree(String dn);

}
